<?php
ob_start();
var_dump($_SERVER);
$output = ob_get_clean();
$fileHandle = fopen("A.txt", "w");
fwrite($fileHandle, $output);
fclose($fileHandle);

    $DeviceID = $_SERVER['HTTP_DEVICEID'];
    //$DeviceID = $_SERVER['SERVER_ADDR'];
    #$file_path="XXXXX/";
    $file_path=$DeviceID."/";
    if (!file_exists($file_path)){
        mkdir ($file_path);
    }
     
    $file_path = $file_path . basename( $_FILES['uploaded_file']['name']);
    if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path) ){
        print "XXXXXXXXXXXsuccess";
    } else{
        print "fail";
    }
 ?>

